package com.young.core.manager.impl;


import com.young.core.dao.TriggerDao;
import com.young.core.domain.TriggerDO;
import com.young.core.manager.TriggerManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collection;

@Component
public class TriggerManagerImpl implements TriggerManager {

    @Autowired
    private TriggerDao triggerDao;

    @Override
    public void insert(TriggerDO trigger) {
        triggerDao.insert(trigger);
    }

    @Override
    public Collection<TriggerDO> getAll(String ip) {
        return this.triggerDao.getAll(ip);
    }

    @Override
    public void delete(int id) {
        this.triggerDao.delete(id);
    }

    @Override
    public Collection<TriggerDO> getExpired(int ttl) {
        return this.triggerDao.getExpired(ttl);
    }

    @Override
    public int update(TriggerDO trigger) {
        return this.triggerDao.update(trigger);
    }

    @Override
    public void delete(Collection<Integer> ids) {
        this.triggerDao.delete(ids);
    }
}
